function out = twoDimDFT(inImg,range)
%Function calculates 2D Discrete Fourier Transform and performs filtering
%using gaussian filter matrix.
out = [];

dftImg= fftshift(fft2(inImg));

filtFunc = fspecial('gaussian',[size(inImg,1) size(inImg,2)],range);

filtImg = dftImg.*filtFunc;

out = real(ifft2(ifftshift(filtImg)));

subplot(1,3,1)
imshow(mat2gray(out))
subplot(1,3,2)
imshow(inImg)
subplot(1,3,3)
imshow(abs(filtImg))

end